home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / csim / source.lha / source / C++SIM / Examples / Machine.h < prev    next >
C/C++ Source or Header  |  1993-06-14  |  697b  |  47 lines

  1. /*
  2.  * Copyright (C) 1993
  3.  *
  4.  * Department of Computing Science,
  5.  * The University,
  6.  * Newcastle upon Tyne,
  7.  * UK.
  8.  */
  9.  
  10. #ifndef MACHINE_H_
  11. #define MACHINE_H_
  12.  
  13. #ifndef RANDOM_H_
  14. #include <Random.h>
  15. #endif
  16.  
  17. #ifndef PROCESS_H_
  18. #include <Process.h>
  19. #endif
  20.  
  21.  
  22. /* This is the machine which services job requests. It is prone to simulated
  23.  * failures caused by the Breaks process.
  24.  */
  25.  
  26. class Machine : public Process
  27. {
  28. public:
  29.     Machine (double);
  30.     ~Machine ();
  31.  
  32.     void Body ();
  33.  
  34.     void Broken ();
  35.     void Fixed ();
  36.     boolean IsOperational ();
  37.     boolean Processing ();
  38.     double ServiceTime ();
  39.  
  40. private:
  41.     ExponentialStream* STime;
  42.     boolean operational;
  43.     boolean working;
  44. };
  45.  
  46. #endif
  47.